<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <textarea></textarea><button onclick="f1()">发布</button>
    <div></div>
</body>
</html>
<script>
    var text=document.querySelector('textarea');
    var div=document.querySelector('div')
    function f1(){
        div.innerHTML=text.value.replace(/fuck|邓小平|/,'****')
    }
</script>